package com.geovis.emergency.spd.util;

/**
 * <p>
 *
 * </p>
 *
 * @author Lonsho
 * @version 1.0
 * @date 2022/7/19
 */
public class Util {

    public static String formatMinute(long minutes){
        int day = (int)Math.floor(minutes / 1440F);
        int hour = day > 0 ? (int)Math.floor((minutes - day * 1440) / 60f) : (int)Math.floor(minutes / 60f);
        int minute = hour > 0 ? (int)Math.floor(minutes - day * 1440f - hour * 60f) : (int)minutes;
        String time = "";
        if (day > 0) {
            time += day + "天";
        }
        if (hour > 0) {
            time += hour + "时";
        }
        if (minute > 0) {
            time += minute + "分";
        }
        return time;
    }
}
